class BunarySearch {
	public int search(int[] nums, int target) {
		int low = 0;
		int high = nums.length-1;
		for(int i = 0 ; i <= nums.length ; i++){
			int mid = ((high + low) / 2);
			if(nums[mid] == target)
				return mid;
			else if(nums[mid] < target)
				low = mid + 1;
			else
				high = mid - 1;
		}
		return -1;
	}
}